var data = [];
var str = [];
var content = '<div></div>  <img src="./xxx.png">';
content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, function (match, capture) {
   data.push(capture);
   str.push(match);
});
console.log(data);
console.log(str);